/**
 * author:Administrator
 * date:2016/1/4
 * desc:TODO
 */

'use strict';

var connedSeq = require('../conn/sequelize.js');
var Sequelize = require('sequelize');
var DataTypes = Sequelize;

var Order = connedSeq.define('order',
  {
    id: {type: DataTypes.INTEGER(11), allowNull: false, primaryKey: true, autoIncrement: true},
    customerId: {type: DataTypes.INTEGER(11), allowNull: false},
    vendorId: {type: DataTypes.INTEGER(11), allowNull: false},
    snapshotId: {type: DataTypes.INTEGER(11), allowNull: false},
    wareId: {type: DataTypes.INTEGER(11), allowNull: false},
    wareCount: {type: DataTypes.INTEGER(11), allowNull: false},
    totalMoney: {type: DataTypes.FLOAT, allowNull: false},

    money: {type: DataTypes.FLOAT, allowNull: false},
    status: {type: DataTypes.STRING, allowNull: false},
    createdAt: {type: DataTypes.INTEGER(11), allowNull: false},
    updatedAt: {type: DataTypes.INTEGER(11), allowNull: true},
    payAt: {type: DataTypes.INTEGER(11), allowNull: true},
    couponLogId: {type: DataTypes.INTEGER(11), allowNull: true}

  },

  {
    tableName: 'order',
    freezeTableName: true,
    createdAt: false,
    updatedAt: false
  });


module.exports = Order;
